<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>beagleoncreate: D:/backups/Desktop/beagleoncreate/trunk/camera/Camera.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">beagleoncreate
   
   </div>
   <div id="projectbrief">Beagleboard sensor interface on iRobot Create with sonar and USB webcam through WiFi</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_camera_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">D:/backups/Desktop/beagleoncreate/trunk/camera/Camera.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_camera_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CAMERA_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CAMERA_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#include &lt;sys/socket.h&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;netinet/in.h&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;netdb.h&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;gst/gst.h&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;gst/app/gstappsink.h&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;gst/app/gstappsrc.h&gt;</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;opencv/cv.h&quot;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;opencv/highgui.h&quot;</span>
<a name="l00012"></a>00012 
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;<a class="code" href="_a_rtag_localizer_8h.html">ARtagLocalizer.h</a>&quot;</span>
<a name="l00014"></a>00014 
<a name="l00019"></a><a class="code" href="_camera_8h.html#a8a436a08fe7e864da5d77e78252a9b54">00019</a> <span class="preprocessor">#define VIDEO_PORT 8855</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a><a class="code" href="_camera_8h.html#aea66ebdaea77072236b4027ffb017fde">00021</a> <span class="preprocessor">#define ARTAG_PORT 8844</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00024"></a><a class="code" href="_camera_8h.html#aa51930a4e04e2d581a8d56b7d6aa5992">00024</a> <span class="preprocessor">#define APPSRCNAME &quot;app-src_01&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a><a class="code" href="_camera_8h.html#a700619615c341c45fc9ad6c55e5206f1">00026</a> <span class="preprocessor">#define APPSINKNAME &quot;app-sink_01&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a><a class="code" href="_camera_8h.html#a6a5a49798a96db987404c8aa3b804fe3">00028</a> <span class="preprocessor">#define IMG_WIDTH 320</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00030"></a><a class="code" href="_camera_8h.html#a509566621a0b52524e800f69546c94be">00030</a> <span class="preprocessor">#define IMG_HEIGHT 240</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a><a class="code" href="class_camera.html">00032</a> <span class="keyword">class </span><a class="code" href="class_camera.html" title="The class that does everything related to the vision sensor. Using gstreamer in this class...">Camera</a>
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 <span class="keyword">public</span>:
<a name="l00035"></a>00035         <a class="code" href="class_camera.html#aa017d8f16d7a14a70ad476e295db80be" title="A constructor for Camera class. Init _sock, _videoPort, and _artagPort. Also call the constructor of ...">Camera</a>(<span class="keywordtype">int</span> remoteSock, <span class="keyword">struct</span> sockaddr_in &amp; videoPort, <span class="keyword">struct</span> sockaddr_in &amp; artagPort);
<a name="l00036"></a>00036         <a class="code" href="class_camera.html#ad1897942d0ccf91052386388a497349f" title="A destructor for Camera class. It calls the destructor of ARtagLocalizer and deletes it...">~Camera</a>();
<a name="l00037"></a>00037         
<a name="l00038"></a>00038         <span class="keywordtype">int</span> <a class="code" href="class_camera.html#ab910352077a06c77263730503194d343" title="The main loop for Camera class. Also calls CleanUp when out of the loop.">StreamARtagVideo</a>();
<a name="l00039"></a>00039         <span class="keywordtype">void</span> <a class="code" href="class_camera.html#a75a98be31f636a8617f96a8df74b0b69" title="A public function to quit the Camera class main loop.">QuitMainLoop</a>();
<a name="l00040"></a>00040         <span class="keywordtype">void</span> <a class="code" href="class_camera.html#aeee2a236b8d1aa06d69504a979388c93" title="Send the image object over through udp.">SendImage</a>(IplImage * image);
<a name="l00041"></a>00041         <span class="keywordtype">void</span> <a class="code" href="class_camera.html#ad0aa22376d9712456f4b818269e13c87" title="Send the ARtag id and pose info over to remote through udp.">SendARtag</a>();
<a name="l00042"></a>00042         <span class="keywordtype">void</span> SetVideoBroadcast(<span class="keywordtype">bool</span> <a class="code" href="class_camera.html#adbda12e714701f9711e1d0159202c28d" title="A getter for the private variable _isBroadcast to broadcast video to MATLAB.">isBroadcast</a>);
<a name="l00043"></a>00043         <span class="keywordtype">bool</span> <a class="code" href="class_camera.html#adbda12e714701f9711e1d0159202c28d" title="A getter for the private variable _isBroadcast to broadcast video to MATLAB.">isBroadcast</a>();
<a name="l00044"></a>00044 
<a name="l00046"></a><a class="code" href="class_camera.html#aa9f53c5a4006bb5c997c8c2c3022eefa">00046</a>         GMainLoop *<a class="code" href="class_camera.html#aa9f53c5a4006bb5c997c8c2c3022eefa">loop</a>;        
<a name="l00048"></a><a class="code" href="class_camera.html#a66acfbb9697d24dfb0a041f34b2e9476">00048</a>         GstElement *<a class="code" href="class_camera.html#a66acfbb9697d24dfb0a041f34b2e9476">pipeline1</a>;
<a name="l00050"></a><a class="code" href="class_camera.html#a06b3425d8f4d6bf19619a46f13621e4c">00050</a>         GstElement *<a class="code" href="class_camera.html#a06b3425d8f4d6bf19619a46f13621e4c">pipeline2</a>;
<a name="l00052"></a><a class="code" href="class_camera.html#a40b1637df19f2c1989c510cb7d740182">00052</a>         IplImage * <a class="code" href="class_camera.html#a40b1637df19f2c1989c510cb7d740182">img</a>;
<a name="l00054"></a><a class="code" href="class_camera.html#a8649f855240bf694c3c8d6d15703d012">00054</a>         IplImage * <a class="code" href="class_camera.html#a8649f855240bf694c3c8d6d15703d012">gray</a>;
<a name="l00056"></a><a class="code" href="class_camera.html#a98302d2133e7a75c26e2b1580a3e52f9">00056</a>         uchar * <a class="code" href="class_camera.html#a98302d2133e7a75c26e2b1580a3e52f9">IMG_data</a>;
<a name="l00058"></a><a class="code" href="class_camera.html#ae45cdadaa176b1243db69fc1c026f0bf">00058</a>         <a class="code" href="class_a_rtag_localizer.html" title="This class is the core class that localize the ARtag using ARToolKitPlus.">ARtagLocalizer</a> * <a class="code" href="class_camera.html#ae45cdadaa176b1243db69fc1c026f0bf">ar</a>;
<a name="l00059"></a>00059         
<a name="l00060"></a>00060 <span class="keyword">private</span>:
<a name="l00061"></a>00061         <span class="keywordtype">int</span> Setup();
<a name="l00062"></a>00062         <span class="keywordtype">void</span> CleanUp();
<a name="l00063"></a>00063 
<a name="l00064"></a>00064         <span class="keywordtype">int</span> _sock;
<a name="l00065"></a>00065         <span class="keyword">struct </span>sockaddr_in _videoPort;
<a name="l00066"></a>00066         <span class="keyword">struct </span>sockaddr_in _artagPort;
<a name="l00067"></a>00067         <span class="keywordtype">bool</span> _isBroadcast;
<a name="l00068"></a>00068 };
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_camera_8h.html">Camera.h</a>      </li>

    <li class="footer">Generated on Sun Feb 12 2012 18:23:34 for beagleoncreate by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
